package com.yanq.liancar.adapter;
/*
 *  @创建者     Administrator
 *  @创建时间   2018/10/23  16:52
 *  @描述       ${TODO}
 */


import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yanq.liancar.R;
import com.yanq.liancar.bean.IntegralDetailBean;

import java.util.List;

public class IntegralDetailAdapter extends BaseQuickAdapter<IntegralDetailBean.DataBean.ListBean,BaseViewHolder>{
    public IntegralDetailAdapter(int layoutResId, @Nullable List<IntegralDetailBean.DataBean.ListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, IntegralDetailBean.DataBean.ListBean item) {
            helper.setText(R.id.tv_Getintegral,"获得"+item.getValue()+"积分")
                    .setText(R.id.tv_time,item.getCreateDate());

        TextView textView=helper.getView(R.id.tv_source);
        if (item.getSrcType()==1){
            textView.setText("优驾抽奖获得");
        }else if (item.getSrcType()==2){
            textView.setText("停驶抽奖获得");
        }else {
            textView.setText("签到抽奖获得");
        }
    }
}
